package com.soundShape.utils
{
	public class StringUtils
	{
		public function StringUtils()
		{
		}
		
		/**
		 * replace '\' with '/'
		 * note that this will appear as '\\' in the actual string
		 * 
		 * example:
		 * 
		 * doSeparatorReplace("c:\test\test.txt") = "c:\\test\\test.txt"
		 * 
		 * @param arg
		 * @return 
		 * 
		 */		
		public static function doSeparatorReplace(arg:String):String
		{
			return arg.replace("&#x5C;","&#x2F;");
		}
		
		public static function doDateParse(date:Date):String
		{
			var temp:Array = date.toString().split(" ");
			return temp[0] + " " + temp[1] + " " + temp[2] + " " + temp[5];
		}
		
		public static function doTimeParse(date:Date):String
		{
			var temp:Array = date.toString().split(" ");
			return temp[3];
		}
		
		public static function doParseMonthDayYear(date:Date):String
		{
			var str:String = null;
			if(date != null)
			{
				var temp:Array = date.toString().split(" ");
				str = temp[0] + " " + temp[1] + " " + temp[2] + " " + temp[5];
			}
		return str;
		}
		
		public static function doParseLabel(strDate:String):String
		{
			var strReturn:String = "";
			if(strDate.length != 1)
			{
				var temp:Array = strDate.split(" ");
				strDate = temp[0] + " " + temp[1] + " " + temp[2] + " " + temp[5];
			}
		return strDate;
		}
	}
}